var countdown = 60;
var timerList = [];
var codeRegain = '重新获取';
var second = '秒';
var countTimers = {};
function setSmsTimeOut(obj) {
    var ele = typeof obj === "undefined" ? $("#getCode") : obj;
    var id = ele.attr('id');
    timerList[id] === undefined ? (timerList[id] = 60) : '';
    if (timerList[id] === 0 || countdown === 0) {
        ele.text(codeRegain).removeClass('btn-secondary').removeAttr('disabled');
        timerList[id] = 60;
        countdown = 60;
    } else {
        ele.text(codeRegain + timerList[id] + second).addClass('btn-secondary').attr('disabled', 'disabled');
        timerList[id]--;
        countdown--;
        countTimers = setTimeout(function() {
            setSmsTimeOut(ele);
        },1000);
    }
}